	import java.util.*;
	
	public class PrimeNumbers
      {
	    public static void main(String[] args) 
            {
	        Scanner inputFromKeybord = new Scanner(System.in);
	        System.out.println("Input number");

	        int inputNumber = inputFromKeybord.nextInt();
	        if (inputNumber < 0) 
                    {
	            System.out.println("Input more than 0");
	            return;
	            }

	        int FPN = 2;
	        System.out.print("All prime numbers before  "+inputNumber+"  :");
	        for (int PrimeNumber = FPN; PrimeNumber <= inputNumber; PrimeNumber++)
               {
	            
                     boolean  isNotPrimeNumber = false;

	            for (int checkNumber = FPN; checkNumber < PrimeNumber; checkNumber++)
                     {
	                if (PrimeNumber % checkNumber == 0)
                           {
	                    isNotPrimeNumber = true;
	                    break;
	                   }
	             }
	                if (isNotPrimeNumber == false)
                           {
	                System.out.print(PrimeNumber+ " ");
	                   }
	        }

	        System.out.println("");
	
	    }
       }